Page({
  data: {
    list:[],
    goodsId:0,
    page:1,
      // 定义轮播图图片资源
      img:[
          '../../imgs/b1.jpg',
          '../../imgs/b2.jpg',
          '../../imgs/b3.jpg',
          '../../imgs/b4.jpg',
          '../../imgs/b5.jpg'
      ],
  },
  onLoad(options){
        let id = options.classifyId
    wx.request({


      url:'https://route.showapi.com/1700-2?showapi_appid=1367085&showapi_sign=cb8507c33e4a43cfa34a954c91b91fd6',
      data:{
        classifyId:id
      },
      success:(res)=>{
        console.log(res);
       this.setData({
         list:res.data.showapi_res_body.contentlist,
         id:id
       })
      }
    })
  },
  onReachBottom(){
    this.data.page++
    wx.request({
      url:'https://route.showapi.com/1700-2?showapi_appid=1367085&showapi_sign=cb8507c33e4a43cfa34a954c91b91fd6',
      data:{
        classifyId:this.data.id
      },
      success:(res)=>{
        console.log(res);
       this.setData({
         list:this.data.list.concat(res.data.showapi_res_body.contentlist)
     
       })
      }
    })



  },
  goValue(e){
  console.log(e);
 const {id,title} =  e.currentTarget.dataset.item
 wx.navigateTo({
   url: `../value/value?id=${id}&title=${title}`,
 })
  }
 
})




   
